package mallindex

import (
	"context"

	// "mall/common/jwt"
	// resultx "mall/common/result"
	"mall/common/utils/pointy"
	"mall/service/forum/api/internal/svc"
	"mall/service/forum/api/internal/types"

	// "mall/service/user/rpc/userclient"

	"github.com/zeromicro/go-zero/core/logx"
)

type GetGoodsKanjiaSetListLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

func NewGetGoodsKanjiaSetListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetGoodsKanjiaSetListLogic {
	return &GetGoodsKanjiaSetListLogic{
		Logger: logx.WithContext(ctx),
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (l *GetGoodsKanjiaSetListLogic) GetGoodsKanjiaSetList(
	req *types.GetGoodsKanjiaSetListReq,
	headers *[]*types.Header,
) (resp *types.GoodsKanjiaSetListResp, err error) {
	// userId := jwt.GetUserId(l.ctx)

	resp = &types.GoodsKanjiaSetListResp{
		BaseListInfo: types.BaseListInfo{
			Current:         1,
			PageSize:        10,
			HasNextPage:     false,
			HasPreviousPage: false,
		},
		List: []*types.GoodsKanjiaSetInfo{
			{
				Id:        pointy.GetPointer(uint64(1)),
				GoodsId:   pointy.GetPointer(uint64(1)),
				NumberBuy: pointy.GetPointer(uint32(15)),
				Number:    pointy.GetPointer(uint32(20)),
			},
			{
				Id:        pointy.GetPointer(uint64(2)),
				GoodsId:   pointy.GetPointer(uint64(2)),
				NumberBuy: pointy.GetPointer(uint32(45)),
				Number:    pointy.GetPointer(uint32(50)),
			},
			{
				Id:        pointy.GetPointer(uint64(3)),
				GoodsId:   pointy.GetPointer(uint64(3)),
				NumberBuy: pointy.GetPointer(uint32(39)),
				Number:    pointy.GetPointer(uint32(40)),
			},
		},
	}

	return resp, nil
}
